type People = { name: string; age: number}
type p = Pick<People, "name">; // 返回 { name: string}

export {};

type P = {
  name: string;
  age?: number;
}

// 将T类型中的所有属性变成可选类型
type MyPartial<T> = { [P in keyof T]?: T[P]}
type a = MyPartial<P>;

// 将T类型中的所有属性变成必选类型
type MyRequired<T> = { [P in keyof T]-?: T[P] }
type b = MyRequired<P>;


// 将T类型中的所有属性变成只读类型
type MyReadonly<T> = { readonly [P in keyof T]: T[P]}
type c = MyReadonly<P>;

type MyOmit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
type O = {
	name: string;
  age: number;
  count: number;
  num: number;
}

type o = MyOmit<O, "age" | "name">
